package org.example.clouddemo.order.feign;

import cn.hutool.core.bean.BeanUtil;
import org.example.clouddemo.bean.common.Param.UpdateProductParam;
import org.example.clouddemo.bean.common.entity.Product;
import org.example.clouddemo.order.service.common.param.GetDetailParam;
import org.example.common.response.ApiResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 通过简单的接口定义实现与Product服务间通信
 */
@FeignClient(value = "service-product", path = "/api/app/product") // value:指定目标服务的注册名 path:公共路径前缀
public interface ProductFeignClient {

    @PostMapping("queryOne")
    ApiResult<Product> queryOne(@Validated @RequestBody Product param);
    @PostMapping("update")
    ApiResult<Integer> update(@Validated @RequestBody UpdateProductParam param) ;

}
